package yf.mall.controller.api;

import com.yf.annotation.IgnoreAuth;
import com.yf.response.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yf.mall.service.MallActService;
import yf.mall.service.SumService;

import java.util.List;

@RestController
@RequestMapping("/act")
public class ApiActController {

    @Autowired
    private MallActService mallActService;
    @Autowired
    private SumService sumService;

    @RequestMapping("/sum/top")
    @IgnoreAuth
    public R sumTop(Long actId, Integer limit) {
        List<Object[]> res = sumService.sumTopUserBuy(actId, limit);
        return R.ok(res);
    }

}
